package com.trkj.pojos;

import java.io.Serializable;
import javax.persistence.*;
import java.util.List;


/**
 * The persistent class for the OFFICE_TYPE database table.
 * 
 */
@Entity
@Table(name="OFFICE_TYPE")
@NamedQuery(name="OfficeType.findAll", query="SELECT o FROM OfficeType o")
public class OfficeType implements Serializable {
	private static final long serialVersionUID = 1L;

	@Id
	@Column(name="OFTP_ID")
	private long oftpId;

	@Column(name="OFTP_NAME")
	private String oftpName;

	//bi-directional many-to-one association to Office
	@OneToMany(mappedBy="officeType")
	private List<Office> offices;

	public OfficeType() {
	}

	public long getOftpId() {
		return this.oftpId;
	}

	public void setOftpId(long oftpId) {
		this.oftpId = oftpId;
	}

	public String getOftpName() {
		return this.oftpName;
	}

	public void setOftpName(String oftpName) {
		this.oftpName = oftpName;
	}

	public List<Office> getOffices() {
		return this.offices;
	}

	public void setOffices(List<Office> offices) {
		this.offices = offices;
	}

	public Office addOffice(Office office) {
		getOffices().add(office);
		office.setOfficeType(this);

		return office;
	}

	public Office removeOffice(Office office) {
		getOffices().remove(office);
		office.setOfficeType(null);

		return office;
	}

}